import Cookies from 'js-cookie'

// token
const TokenKey = 'Admin-Token'
// 用户ID
const UserID = 'Admin-UserId'
// code
const Code = 'Adminn-Code'

// 缓存token
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
// 缓存token
export function getUserID(token) {
  return Cookies.get(UserID, token)
}
// 缓存user_id
export function setUserID(user_id) {
  return Cookies.set(UserID, user_id)
}
// 储存code
export function setCode(code) {
  return Cookies.set(Code, code)
}
// 获取code
export function getCode(code) {
  return Cookies.get(Code)
}
// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 清除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 清除user_id
export function removeUserId() {
  return Cookies.remove(UserID)
}
